home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 July / CHIP 2006-07.2.iso / program / web_gelistirme / easyphp1-7_setup.exe / {app} / phpmyadmin / tbl_indexes.php < prev    next >
Encoding:
PHP Script  |  2003-09-07  |  19.9 KB  |  515 lines

  1. <?php
  2. /* $Id: tbl_indexes.php,v 1.34 2003/05/22 09:51:01 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Gets some core libraries
  8.  */
  9. if (!defined('PMA_GRAB_GLOBALS_INCLUDED')) {
  10.     include('./libraries/grab_globals.lib.php');
  11. }
  12. if (!defined('PMA_COMMON_LIB_INCLUDED'))  {
  13.     include('./libraries/common.lib.php');
  14. }
  15.  
  16.  
  17. /**
  18.  * Defines the index types ("FULLTEXT" is available since MySQL 3.23.23)
  19.  */
  20. $index_types_cnt   = 3;
  21. $index_types       = array(
  22.     'PRIMARY',
  23.     'INDEX',
  24.     'UNIQUE'
  25. );
  26. if (PMA_MYSQL_INT_VERSION >= 32323) {
  27.     $index_types[] = 'FULLTEXT';
  28.     $index_types_cnt++;
  29. }
  30.  
  31.  
  32. /**
  33.  * Ensures the db & table are valid, then loads headers and gets indexes
  34.  * informations.
  35.  * Skipped if this script is called by "tbl_properties.php"
  36.  */
  37. if (!defined('PMA_IDX_INCLUDED')) {
  38.     // Not a valid db name -> back to the welcome page
  39.     if (!empty($db)) {
  40.         $is_db = @PMA_mysql_select_db($db);
  41.     }
  42.     if (empty($db) || !$is_db) {
  43.         header('Location: ' . $cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
  44.         exit();
  45.     }
  46.     // Not a valid table name -> back to the default db_details sub-page
  47.     if (!empty($table)) {
  48.         $is_table = @PMA_mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
  49.     }
  50.     if (empty($table)
  51.         || !($is_table && @mysql_numrows($is_table))) {
  52.         header('Location: ' . $cfg['PmaAbsoluteUri'] . $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db, '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
  53.         exit();
  54.     } else if (isset($is_table)) {
  55.         mysql_free_result($is_table);
  56.     }
  57.  
  58.     // Displays headers (if needed)
  59.     $js_to_run = ((isset($index) && isset($do_save_data)) ? 'functions.js' : 'indexes.js');
  60.     include('./header.inc.php');
  61. } // end if
  62.  
  63.  
  64. /**
  65.  * Gets fields and indexes informations
  66.  */
  67. if (defined('PMA_IDX_INCLUDED')) {
  68.     $err_url_0 = 'db_details.php?' . PMA_generate_common_url($db);
  69. }
  70.  
  71. //  Gets table keys and store them in arrays
  72. $indexes      = array();
  73. $prev_index   = '';
  74. $indexes_info = array();
  75. $indexes_data = array();
  76. // keys had already been grabbed in "tbl_properties.php"
  77. if (defined('PMA_IDX_INCLUDED')) {
  78.     $idx_cnt     = count($ret_keys);
  79. } else {
  80.     $local_query = 'SHOW KEYS FROM ' . PMA_backquote($table);
  81.     $result      = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
  82.     $idx_cnt     = mysql_num_rows($result);
  83. }
  84.  
  85. for ($i = 0; $i < $idx_cnt; $i++) {
  86.     $row = (defined('PMA_IDX_INCLUDED') ? $ret_keys[$i] : PMA_mysql_fetch_array($result));
  87.  
  88.     if ($row['Key_name'] != $prev_index ){
  89.         $indexes[]  = $row['Key_name'];
  90.         $prev_index = $row['Key_name'];
  91.     }
  92.     $indexes_info[$row['Key_name']]['Sequences'][]     = $row['Seq_in_index'];
  93.     $indexes_info[$row['Key_name']]['Non_unique']      = $row['Non_unique'];
  94.     if (isset($row['Cardinality'])) {
  95.         $indexes_info[$row['Key_name']]['Cardinality'] = $row['Cardinality'];
  96.     }
  97. //    I don't know what does following column mean....
  98. //    $indexes_info[$row['Key_name']]['Packed']          = $row['Packed'];
  99.     $indexes_info[$row['Key_name']]['Comment']         = (isset($row['Comment']))
  100.                                                        ? $row['Comment']
  101.                                                        : '';
  102.     $indexes_info[$row['Key_name']]['Index_type']      = (isset($row['Index_type']))
  103.                                                        ? $row['Index_type']
  104.                                                        : '';
  105.  
  106.     $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Column_name']  = $row['Column_name'];
  107.     if (isset($row['Sub_part'])) {
  108.         $indexes_data[$row['Key_name']][$row['Seq_in_index']]['Sub_part'] = $row['Sub_part'];
  109.     }
  110. } // end while
  111.  
  112. if (defined('PMA_IDX_INCLUDED')) {
  113.     unset($ret_keys);
  114. } else if ($result) {
  115.     mysql_free_result($result);
  116. }
  117.  
  118. // Get fields and stores their name/type
  119. // fields had already been grabbed in "tbl_properties.php"
  120. if (defined('PMA_IDX_INCLUDED')) {
  121.     mysql_data_seek($fields_rs, 0);
  122. } else {
  123.     $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($table);
  124.     $fields_rs   = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
  125.     $fields_cnt  = mysql_num_rows($fields_rs);
  126. }
  127.  
  128. $fields_names           = array();
  129. $fields_types           = array();
  130. while ($row = PMA_mysql_fetch_array($fields_rs)) {
  131.     $fields_names[]     = $row['Field'];
  132.     // loic1: set or enum types: slashes single quotes inside options
  133.     if (eregi('^(set|enum)\((.+)\)$', $row['Type'], $tmp)) {
  134.         $tmp[2]         = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
  135.         $fields_types[] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
  136.     } else {
  137.         $fields_types[] = $row['Type'];
  138.     }
  139. } // end while
  140.  
  141. if ($fields_rs) {
  142.     mysql_free_result($fields_rs);
  143. }
  144.  
  145.  
  146. /**
  147.  * Do run the query to build the new index and moves back to
  148.  * "tbl_properties.php"
  149.  */
  150. if (!defined('PMA_IDX_INCLUDED')
  151.     && (isset($index) && isset($do_save_data))) {
  152.  
  153.     $err_url     = 'tbl_indexes.php?' . PMA_generate_common_url($db, $table);
  154.     if (empty($old_index)) {
  155.         $err_url .= '&create_index=1&idx_num_fields=' . $idx_num_fields;
  156.     } else {
  157.         $err_url .= '&index=' . urlencode($old_index);
  158.     }
  159.  
  160.     if ($index_type == 'PRIMARY') {
  161.         if ($index == '') {
  162.             $index = 'PRIMARY';
  163.         } else if ($index != 'PRIMARY') {
  164.             PMA_mysqlDie($strPrimaryKeyName, '', FALSE, $err_url);
  165.         }
  166.     } else if ($index == 'PRIMARY') {
  167.          PMA_mysqlDie($strCantRenameIdxToPrimary, '', FALSE, $err_url);
  168.     }
  169.  
  170.  
  171.     // $sql_query is the one displayed in the query box
  172.     $sql_query         = 'ALTER TABLE ' . PMA_backquote($table);
  173.  
  174.     // Drops the old index
  175.     if (!empty($old_index)) {
  176.         if ($old_index == 'PRIMARY') {
  177.             $sql_query .= ' DROP PRIMARY KEY,';
  178.         } else {
  179.             $sql_query .= ' DROP INDEX ' . PMA_backquote($old_index) .',';
  180.         }
  181.     } // end if
  182.  
  183.     // Builds the new one
  184.     switch ($index_type) {
  185.         case 'PRIMARY':
  186.             $sql_query .= ' ADD PRIMARY KEY (';
  187.             break;
  188.         case 'FULLTEXT':
  189.             $sql_query .= ' ADD FULLTEXT ' . (empty($index) ? '' : PMA_backquote($index)) . ' (';
  190.             break;
  191.         case 'UNIQUE':
  192.             $sql_query .= ' ADD UNIQUE ' . (empty($index) ? '' : PMA_backquote($index)) . ' (';
  193.             break;
  194.         case 'INDEX':
  195.             $sql_query .= ' ADD INDEX ' . (empty($index) ? '' : PMA_backquote($index)) . ' (';
  196.             break;
  197.     } // end switch
  198.     $index_fields         = '';
  199.     while (list($i, $name) = each($column)) {
  200.         if ($name != '--ignore--') {
  201.             $index_fields .= (empty($index_fields) ? '' : ',')
  202.                           . PMA_backquote($name)
  203.                           . (empty($sub_part[$i]) ? '' : '(' . $sub_part[$i] . ')');
  204.         }
  205.     } // end while
  206.     if (empty($index_fields)){
  207.         PMA_mysqlDie($strNoIndexPartsDefined, '', FALSE, $err_url);
  208.     } else {
  209.         $sql_query .= $index_fields . ')';
  210.     }
  211.  
  212.     $result    = PMA_mysql_query($sql_query) or PMA_mysqlDie('', $sql_query, FALSE, $err_url);
  213.     $message   = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
  214.  
  215.     $active_page = 'tbl_properties_structure.php';
  216.     include('./tbl_properties_structure.php');
  217.     exit();
  218. } // end builds the new index
  219.  
  220.  
  221. /**
  222.  * Edits an index or defines a new one
  223.  */
  224. else if (!defined('PMA_IDX_INCLUDED')
  225.          && (isset($index) || isset($create_index))) {
  226.  
  227.     // Prepares the form values
  228.     if (!isset($index)) {
  229.         $index                                = '';
  230.     }
  231.     if (!isset($old_index)){
  232.         $old_index                            = $index;
  233.     }
  234.     if (!isset($index_type)) {
  235.         $index_type                           = '';
  236.     }
  237.     if ($old_index == '' || !isset($indexes_info[$old_index])) {
  238.         $edited_index_info['Sequences']       = array();
  239.         $edited_index_data                    = array();
  240.         for ($i = 1; $i <= $idx_num_fields; $i++) {
  241.             $edited_index_info['Sequences'][] = $i;
  242.             $edited_index_data[$i]            = array('Column_name' => '', 'Sub_part' => '');
  243.         } // end for
  244.         if ($old_index == ''
  245.             && !isset($indexes_info['PRIMARY'])
  246.             && ($index_type == '' || $index_type == 'PRIMARY')) {
  247.             $old_index                        = 'PRIMARY';
  248.         }
  249.     } else {
  250.         $edited_index_info                    = $indexes_info[$old_index];
  251.         $edited_index_data                    = $indexes_data[$old_index];
  252.  
  253.  
  254.         if ((PMA_MYSQL_INT_VERSION >= 32323 && PMA_MYSQL_INT_VERSION < 40002 && $edited_index_info['Comment'] == 'FULLTEXT')
  255.                 || (PMA_MYSQL_INT_VERSION >= 40002 && $edited_index_info['Index_type'] == 'FULLTEXT')) {
  256.             $index_type                       = 'FULLTEXT';
  257.         } else if ($index == 'PRIMARY') {
  258.             $index_type                       = 'PRIMARY';
  259.         } else if ($edited_index_info['Non_unique'] == '0') {
  260.             $index_type                       = 'UNIQUE';
  261.         } else {
  262.             $index_type                       = 'INDEX';
  263.         }
  264.     } // end if... else...
  265.  
  266.     if (isset($add_fields)) {
  267.         if (isset($prev_add_fields)) {
  268.             $added_fields += $prev_add_fields;
  269.         }
  270.         $field_cnt = count($edited_index_info['Sequences']) + 1;
  271.         for ($i = $field_cnt; $i < ($added_fields + $field_cnt); $i++) {
  272.             $edited_index_info['Sequences'][] = $i;
  273.             $edited_index_data[$i]            = array('Column_name' => '', 'Sub_part' => '');
  274.         } // end for
  275.  
  276.         // Restore entered values
  277.         while (list($i, $name) = each($column)) {
  278.             if ($name != '--ignore--'){
  279.                 $edited_index_data[$i+1]['Column_name'] = $name;
  280.                 $edited_index_data[$i+1]['Sub_part']    = $sub_part[$i];
  281.             }
  282.         } // end while
  283.     } // end if
  284.     // end preparing form values
  285.     ?>
  286.  
  287. <!-- Build index form -->
  288. <form action="tbl_indexes.php" method="post" name="index_frm"
  289.     onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') {this.elements['index'].disabled = false}">
  290.     <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
  291.     <?php
  292.     if (isset($create_index)) {
  293.         echo '<input type="hidden" name="create_index" value="1" />';
  294.     }
  295.     echo "\n";
  296.     ?>
  297.     <input type="hidden" name="old_index" value="<?php echo (isset($create_index) ? '' : htmlspecialchars($old_index)); ?>" />
  298.     <b><?php echo '------ ' . (isset($create_index) ? $strCreateIndexTopic : $strModifyIndexTopic) . ' ------'; ?></b>
  299.     <br /><br />
  300.  
  301.     <table border="0">
  302.     <tr>
  303.         <td><?php echo $strIndexName; ?> </td>
  304.         <td>
  305.             <input type="text" name="index" value="<?php echo htmlspecialchars($index); ?>" class="textfield" onfocus="this.select()" />
  306.              <?php echo $strPrimaryKeyWarning . "\n"; ?>
  307.         </td>
  308.     </tr>
  309.     <tr>
  310.         <td><?php echo $strIndexType; ?> </td>
  311.         <td>
  312.             <select name="index_type" onchange="return checkIndexName()">
  313.     <?php
  314.     echo "\n";
  315.     for ($i = 0; $i < $index_types_cnt; $i++) {
  316.         if ($index_types[$i] == 'PRIMARY') {
  317.             if ($index == 'PRIMARY' || !isset($indexes_info['PRIMARY'])) {
  318.                 echo '                '
  319.                      . '<option value="PRIMARY"' . (($index_type == 'PRIMARY') ? ' selected="selected"' : '') . '>PRIMARY</option>'
  320.                      . "\n";
  321.             }
  322.         } else {
  323.             echo '                '
  324.                  . '<option value="' . $index_types[$i] . '"' . (($index_type == $index_types[$i]) ? ' selected="selected"' : '') . '>'. $index_types[$i] . '</option>'
  325.                  . "\n";
  326.  
  327.         } // end if... else...
  328.     } // end for
  329.     ?>
  330.             </select> 
  331.             <?php echo PMA_showMySQLDocu('Reference', 'ALTER_TABLE') . "\n"; ?>
  332.         </td>
  333.     </tr>
  334.     </table><br />
  335.  
  336.     <table border="<?php echo $cfg['Border']; ?>" cellpadding="5">
  337.     <tr>
  338.         <th><?php echo $strField; ?></th>
  339.         <th><?php echo $strSize; ?></th>
  340.     </tr>
  341.     <?php
  342.     while (list($row_no, $seq_index) = each($edited_index_info['Sequences'])) {
  343.         $add_type     = (is_array($fields_types) && count($fields_types) == count($fields_names));
  344.         $selected     = $edited_index_data[$seq_index]['Column_name'];
  345.         if (!empty($edited_index_data[$seq_index]['Sub_part'])) {
  346.             $sub_part = ' value="' . $edited_index_data[$seq_index]['Sub_part'] . '"';
  347.         } else {
  348.             $sub_part = '';
  349.         }
  350.         $bgcolor      = (($row_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']);
  351.         echo "\n";
  352.         ?>
  353.     <tr>
  354.         <td bgcolor="<?php echo $bgcolor; ?>">
  355.             <select name="column[]">
  356.                 <option value="--ignore--"<?php if ('--ignore--' == $selected) echo ' selected="selected"'; ?>>
  357.                     -- <?php echo $strIgnore; ?> --</option>
  358.         <?php
  359.         reset($fields_names);
  360.         while (list($key, $val) = each($fields_names)) {
  361.             if ($index_type != 'FULLTEXT'
  362.                 || eregi('^(varchar|text|tinytext|mediumtext|longtext)', $fields_types[$key])) {
  363.                 echo "\n" . '                '
  364.                      . '<option value="' . htmlspecialchars($val) . '"' . (($val == $selected) ? ' selected="selected"' : '') . '>'
  365.                      . htmlspecialchars($val) . (($add_type) ? ' [' . $fields_types[$key] . ']' : '' ) . '</option>' . "\n";
  366.             }
  367.         } // end while
  368.         echo "\n";
  369.         ?>
  370.             </select>
  371.         </td>
  372.         <td bgcolor="<?php echo $bgcolor; ?>">
  373.             <input type="text" size="5" name="sub_part[]"<?php echo $sub_part; ?> onfocus="this.select()" />
  374.         </td>
  375.     </tr>
  376.         <?php
  377.     } // end while
  378.  
  379.     echo "\n";
  380.     ?>
  381.     </table><br />
  382.  
  383.     <input type="submit" name="do_save_data" value="<?php echo $strSave; ?>" /><br />
  384.  
  385.     <?php
  386.     echo "\n";
  387.     if (isset($added_fields)) {
  388.         echo '    <input type="hidden" name="prev_add_fields" value="' . $added_fields . '" />';
  389.     }
  390.     if (isset($idx_num_fields)) {
  391.         echo '    <input type="hidden" name="idx_num_fields" value="' . $idx_num_fields . '" />' . "\n";
  392.     }
  393.     echo '    <hr /><br />' . "\n";
  394.     echo '    ' . sprintf($strAddToIndex,  '<input type="text" name="added_fields" size="4" value="1" class="textfield" onfocus="this.select()" />') . "\n";
  395.     echo '     <input type="submit" name="add_fields" value="' . $strGo . '" onclick="return checkFormElementInRange(this.form, \'added_fields\', 1)" />' . "\n";
  396.  
  397. } else {
  398.     /**
  399.      * Display indexes
  400.      */
  401.     ?>
  402.     <!-- Indexes form -->
  403.     <form action="tbl_indexes.php" method="post">
  404.         <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
  405.     <?php
  406.     echo "\n";
  407.     echo '        ' . $strIndexes . ' :' . "\n";
  408.     echo '        ' . PMA_showMySQLDocu('MySQL_Optimisation', 'Optimising_Database_Structure') . '<br />' ."\n";
  409.  
  410.     if ($idx_cnt > 0) {
  411.         ?>
  412.         <table border="<?php echo $cfg['Border']; ?>">
  413.         <tr>
  414.             <th><?php echo $strKeyname; ?></th>
  415.             <th><?php echo $strType; ?></th>
  416.             <th><?php echo $strCardinality; ?></th>
  417.             <th colspan="2"><?php echo $strAction; ?></th>
  418.             <th colspan="2"><?php echo $strField; ?></th>
  419.         </tr>
  420.         <?php
  421.         echo "\n";
  422.         while (list($index_no, $index_name) = each($indexes)) {
  423.             $cell_bgd = (($index_no % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']);
  424.             $index_td = '            <td bgcolor="' . $cell_bgd . '" rowspan="' . count($indexes_info[$index_name]['Sequences']) . '">' . "\n";
  425.             echo '        <tr>' . "\n";
  426.             echo $index_td
  427.                  . '                ' . htmlspecialchars($index_name) . "\n"
  428.                  . '            </td>' . "\n";
  429.  
  430.             if ((PMA_MYSQL_INT_VERSION >= 32323 && PMA_MYSQL_INT_VERSION < 40002 && $indexes_info[$index_name]['Comment'] == 'FULLTEXT')
  431.                 || (PMA_MYSQL_INT_VERSION >= 40002 && $indexes_info[$index_name]['Index_type'] == 'FULLTEXT')) {
  432.                 $index_type = 'FULLTEXT';
  433.             } else if ($index_name == 'PRIMARY') {
  434.                 $index_type = 'PRIMARY';
  435.             } else if ($indexes_info[$index_name]['Non_unique'] == '0') {
  436.                 $index_type = 'UNIQUE';
  437.             } else {
  438.                 $index_type = 'INDEX';
  439.             }
  440.             echo $index_td
  441.                  . '                ' . $index_type . "\n"
  442.                  . '            </td>' . "\n";
  443.  
  444.             echo str_replace('">' . "\n", '" align="right">' . "\n", $index_td)
  445.                  . '                ' . (isset($indexes_info[$index_name]['Cardinality']) ? $indexes_info[$index_name]['Cardinality'] : $strNone) . ' ' . "\n"
  446.                  . '            </td>' . "\n";
  447.  
  448.             if ($index_name == 'PRIMARY') {
  449.                 $local_query = urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP PRIMARY KEY');
  450.                 $js_msg    = 'ALTER TABLE ' . PMA_jsFormat($table) . ' DROP PRIMARY KEY';
  451.                 $zero_rows = urlencode($strPrimaryKeyHasBeenDropped);
  452.             } else {
  453.                 $local_query = urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP INDEX ' . PMA_backquote($index_name));
  454.                 $js_msg    = 'ALTER TABLE ' . PMA_jsFormat($table) . ' DROP INDEX ' . PMA_jsFormat($index_name);
  455.                 $zero_rows = urlencode(sprintf($strIndexHasBeenDropped, htmlspecialchars($index_name)));
  456.             }
  457.             echo $index_td
  458.                  . '                <a href="sql.php?' . $url_query . '&sql_query=' . $local_query . '&zero_rows=' . $zero_rows . '" onclick="return confirmLink(this, \'' . $js_msg . '\')">' . $strDrop . '</a>' . "\n"
  459.                  . '            </td>' . "\n";
  460.  
  461.             echo $index_td
  462.                  . '                <a href="tbl_indexes.php?' . $url_query . '&index=' . urlencode($index_name) . '">' . $strEdit . '</a>' . "\n"
  463.                  . '            </td>' . "\n";
  464.  
  465.             while (list($row_no, $seq_index) = each($indexes_info[$index_name]['Sequences'])) {
  466.                 if ($row_no > 0) {
  467.                     echo '        <tr>' . "\n";
  468.                 }
  469.                 if (!empty($indexes_data[$index_name][$seq_index]['Sub_part'])) {
  470.                     echo '            <td bgcolor="' . $cell_bgd . '">' . "\n"
  471.                          . '                ' . $indexes_data[$index_name][$seq_index]['Column_name'] . "\n"
  472.                          . '            </td>' . "\n";
  473.                     echo '            <td align="right" bgcolor="' . $cell_bgd . '">' . "\n"
  474.                          . '                ' . $indexes_data[$index_name][$seq_index]['Sub_part'] . "\n"
  475.                          . '            </td>' . "\n";
  476.                     echo '        </tr>' . "\n";
  477.                 } else {
  478.                     echo '            <td bgcolor="' . $cell_bgd . '" colspan="2">' . "\n"
  479.                          . '                ' . htmlspecialchars($indexes_data[$index_name][$seq_index]['Column_name']) . "\n"
  480.                          . '            </td>' . "\n";
  481.                     echo '        </tr>' . "\n";
  482.                 }
  483.             } // end while
  484.         } // end while
  485.         ?>
  486.         </table><br />
  487.         <?php
  488.         echo "\n\n";
  489.     } // end display indexes
  490.     else {
  491.         // none indexes
  492.         echo "\n" . '        <br />' . "\n";
  493.         echo '        <i>' . $strNoIndex . '</i><br /><br />' . "\n\n";
  494.     }
  495.  
  496.     echo '        ' . sprintf($strCreateIndex, '<input type="text" size="4" name="idx_num_fields" value="1" class="textfield" />') . "\n";
  497.     echo '         <input type="submit" name="create_index" value="' . $strGo . '" onclick="return checkFormElementInRange(this.form, \'idx_num_fields\', 1)" />' . "\n";
  498.     echo '    ';
  499. } // end display indexes
  500.  
  501. ?>
  502. </form>
  503.  
  504.  
  505. <?php
  506. /**
  507.  * Displays the footer
  508.  */
  509. echo "\n";
  510.  
  511. if (!defined('PMA_IDX_INCLUDED')){
  512.     include('./footer.inc.php');
  513. }
  514. ?>
  515.